from selenium import webdriver
import os,time
os.makedirs('./img2/',exist_ok=True)
driver = webdriver.Firefox()

driver.get("https://morvanzhou.github.io/")
time.sleep(2)
driver.find_element_by_link_text(u"赞助").click()
time.sleep(2)
driver.find_element_by_link_text(u"大家说").click()
time.sleep(2)
driver.find_element_by_link_text(u"教程 ▾").click()
time.sleep(2)
driver.find_element_by_link_text(u"推荐学习顺序").click()
time.sleep(2)
driver.find_element_by_link_text(u"在机器学习前 - (零基础)").click()
time.sleep(2)


html = driver.page_source  # get html
driver.get_screenshot_as_file('./img/img.png')
#driver.close()
print(html[:200])